package com.itheima.reggie.controller;

import com.itheima.reggie.entity.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public R<String> handlerException(Exception e) {
        e.printStackTrace();
        return R.error("温馨提示：" + e.getMessage());
    }
}
